<template>
  <div>
    <div class="title">热门推荐</div>
    <ul>
      <li class="item border" v-for="item in recommendList" :key="item.id">
        <img class="item-img" :src="item.imgUrl" >
        <div class="item-info">
          <div class="item-title" v-text="item.title"></div>
          <div class="item-desc" v-text="item.desc"></div>
          <div class="item-button">查看详情</div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
  export default {
    name: 'HomeRecommend',
    data: function () {
      return {
        recommendList: [
          {
            id: '0001',
            imgUrl: 'http://img1.qunarzz.com/sight/p0/1707/57/5729585581b6732fa3.water.jpg_200x200_85298361.jpg',
            title: '我是标题',
            desc: '我是内容'
          },
          {
            id: '0002',
            imgUrl: 'http://img1.qunarzz.com/sight/p0/1707/57/5729585581b6732fa3.water.jpg_200x200_85298361.jpg',
            title: '我是标题',
            desc: '我是内容'
          }
        ]
      }
    }
  }
</script>

<style lang="stylus" scoped>
  @import "~styles/mixins.styl"
  .title
    width : 100%
    background : #eee
    line-height .8rem
    text-indent .2rem
    margin-top .2rem
  .item
    height : 2.4rem
    background white
    display flex
    overflow hidden
    .item-img
      width 2rem
      height 2rem
      padding .1rem
    .item-info
      flex 1
      padding : .1rem
      min-width 0
      .item-title
        line-height .54rem
        ellipsis()
      .item-desc
        line-height .54rem
        ellipsis()
      .item-button
        display inline-block
        line-height .44rem
        background #ff9300
        padding 0 .2rem
        border-radius .06rem
        margin-top .2rem
        color #ffffff

</style>
